Skip to content

Conversation

@nicolastomeo
Copy link

Issue #, if available:
In Python libraries like https://github.com/awslabs/aws-sdk-python/tree/develop/clients/aws-sdk-transcribe-streaming and https://github.com/awslabs/amazon-transcribe-streaming-sdk where awscrt is used, a few people, me included notice an issue where futures that are already done (cancelled) are being set so an InvalidStateError is raised.
Examples: awslabs/amazon-transcribe-streaming-sdk#61 and awslabs/aws-sdk-python#13

Description of changes:
Just checking if future is not done before setting the result.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@nicolastomeo
Copy link
Author

Tagging @jonathan343 since I saw him actively working on https://github.com/awslabs/aws-sdk-python

Thanks in advance.

@nicolastomeo nicolastomeo changed the title Checks if future are done in AIOHttpClientStreamUnified to avoid race condition Checks if futures are done in AIOHttpClientStreamUnified to avoid race condition Nov 21, 2025
@TingDaoK
Copy link
Contributor

TingDaoK commented Dec 3, 2025

@nicolastomeo
Hi, thank you for submitting the PR.
Do you have a reproduce case that we can use to locate the state better and have a better understanding of this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants